<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>6、返回两个日期之间相差的天数。</title>
</head>

<body>
  <script>
    var date1 = new Date("2013-11-29");
    var date2 = new Date("2013-11-20");
    let age = date1 - date2
    console.log(age / 86400000) 
  </script>
</body>

</html>